package demo1;

import entity.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-03
 * Time: 11:46
 */
@Component
public class StudentCenter {

    @Bean
    public Student getStudentByName() {
        Student student = new Student();
        student.setName("zhangsan");
        student.setAge(18);
        return student;
    }

    @Bean
    public Student getStudentByAge() {
        Student student = new Student();
        student.setName("lisi");
        student.setAge(20);
        return student;
    }
}
